-- GENERATED SPELL FOR [Shadowmoon Deathshaper] --


function spell0_22882(pUnit, Event) --@Death Coil,n/a--
pUnit:FullCastSpellOnTarget(41070,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22882', 3293, 1)
end

function spell1_22882(pUnit, Event) --@Demon Armor,Self--
pUnit:FullCastSpellOnTarget(13787,pUnit)
pUnit:RegisterEvent('Sorts_22882', 0, 1)
end

function spell2_22882(pUnit, Event) --@Raise Dead,n/a--
pUnit:FullCastSpellOnTarget(41071,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22882', 1500, 1)
end

function spell3_22882(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(41069,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22882', 3000, 1)
end

function Sorts_22882(pUnit, Event)
local choix_sorts_22882 = math.random(0, 3)
if choix_sorts_22882 == 0 then
pUnit:RegisterEvent('spell0_22882', 1, 1)
end
if choix_sorts_22882 == 1 then
pUnit:RegisterEvent('spell1_22882', 1, 1)
end
if choix_sorts_22882 == 2 then
pUnit:RegisterEvent('spell2_22882', 1, 1)
end
if choix_sorts_22882 == 3 then
pUnit:RegisterEvent('spell3_22882', 1, 1)
end
end

function mob22882_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22882', math.random(1500, 3000), 1)
end

function mob22882_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22882_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22882_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22882, 1, 'mob22882_Action')
RegisterUnitEvent(22882, 2, 'mob22882_Leave')
RegisterUnitEvent(22882, 3, 'mob22882_Kill')
RegisterUnitEvent(22882, 4, 'mob22882_Die')
